<template>


<div>

    <p>

    备注: 
    1、参数名需要保持一致 
    2、如果路由中没有传参

    {{username}}

    <br/>

    <button v-on:click="testA"><h1>get</h1></button>
     <br/>
    <router-link :to="{ name:'NewPageSub' , params:{ userId:12003 } }">NewPageSub</router-link>

    </p> 

    <div style="width:100%;height:100px;">
        <router-view />
    </div>


</div>    

</template>


<script>

import axios from 'axios'


export default {
  name: "NewPage",
  data() {
    return {
      name: "itext",
      username:'结尾啦'
    };
  },
  mounted() {
    console.log("打印我需要的东西");
    const appId = this.$route.query.id ;
    console.log(this.$route.query) ;
    console.log("////////////////////"+appId);

  },
  methods: {
    testA() {
        //alert(0);
        // 跨域
        axios.get('http://www.baidu.com/').then((response) => {
            console.log(response.data)
        })
    },
    testB() {}
  }
};
</script>

<style scoped>
</style>